package com.visionblue.business.ship.model.bean.response

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import java.io.Serializable
import java.math.BigDecimal

/**
 * @author: xlh
 * @date: 2020-05-21 3:47 PM
 * @desc:
 */
@Parcelize
class ApplicationDetail(
    var id: String?,
    var recordNo: String?,
    var shipName: String?,
    var receiveShipName:String?,
    var producerName:String?,
    var status: Int,
    var readStatus: Int,
    var pdfUrl: String?,
    var wasteInfos: Map<String, BigDecimal>?,
    var workTime: Long?,
    var createTime: Long,
    var shipInfo: ShipInfo?,
    var address: String?,
    var recordType: Int,
    var poiName: String?,
    var longitude: String?,
    var latitude: String?,

    var applicationItems: List<DeclareWaste>

    ) : Parcelable {
    /**
     * id : 1
     * recordNo : 9b9a9db61c2f4a2682937b1ba0157575
     * shipName : null
     * status : 2
     * readStatus : 1
     * pdfUrl : null
     * wasteInfos : {"1":"12.22","2":"0.56","3":"2.82"}
     * workTime : 1589536800000
     * createTime : 1589857267000
     * shipInfo : {"shipNo":"BZSHIP001","shipName":"商船001","shipModel":null,"mobile":"13061052777","conflicting":false,"shipType":1}
     * address : 浙江省台州市路桥区金清镇
     * poiName : 金清镇
     * longitude : 121.525131
     * latitude : 28.513453
     */

    // 申报记录已读状态， 1：未读， 2：已读
    fun isRead() = readStatus == 2
}

data class DeclareWaste(
    var id: Int,
    var parentId: Int,
    var wasteType: String,
    var weight:Double,
    var originWeight:Double,
    var collectionWeight:Double

): Serializable